package com.wzy.strage;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: wzy
 * @Date: 2021/11/06/8:37
 * @Description:
 */
public class OperationController {

    public static void main(String[] args) {
        OperationContext operationContext = new OperationContext(AddOperation.getInstance());
        OperationContext subOperationContext = new OperationContext(new SubtractOperation());
        int sum = operationContext.executeStrategy(1, 2);
        int sub = subOperationContext.executeStrategy(2, 1);
        System.out.println(sum);
        System.out.println(sub);
    }
}
